<?php
namespace app\admin\controller;
use think\Controller;
use think\Request;
use app\admin\model\Admin_model;
class  Admin extends Controller
{
    function __construct(Request $request = null)
    {
        parent::__construct($request);
        if(session('user')) {
            $user=session('user');
            $admin_model=new Admin_model();
            $fun=$admin_model->get_rolefunction($user['role']);
            $this->assign('fun',$fun);
        }else{
            $this->redirect('index/login/index');
        }
    }
    function index(){
        if(session('user')) {
            $this->assign('title','首页');
            return $this->fetch();
        }
        $this->redirect('admin/admin/index');
    }
    //管理员
    function admin_fun(){
        $this->assign('title','管理员');
        return $this->fetch();
    }

    //代理用户
    function agent_user(){
        $this->assign('title','代理用户');
        return $this->fetch();
    }
    //子账户
    function child_users(){

        $this->assign('title','子账户');
        return $this->fetch();
    }
    //广告主
    function advertisers(){
        $this->assign('title','广告主');
        return $this->fetch();
    }


}